/* 全局转场效果样式 */

/* 基础转场容器 */
.transition-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
}

/* 滑动转场效果 */
.slide-left-enter-active,
.slide-left-leave-active,
.slide-right-enter-active,
.slide-right-leave-active {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-left-enter-from {
  transform: translateX(100%);
  opacity: 0;
}

.slide-left-leave-to {
  transform: translateX(-100%);
  opacity: 0;
}

.slide-right-enter-from {
  transform: translateX(-100%);
  opacity: 0;
}

.slide-right-leave-to {
  transform: translateX(100%);
  opacity: 0;
}

/* 缩放转场效果 */
.scale-up-enter-active,
.scale-up-leave-active,
.scale-down-enter-active,
.scale-down-leave-active {
  transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.scale-up-enter-from {
  transform: scale(0.95) translateY(20px);
  opacity: 0;
}

.scale-up-leave-to {
  transform: scale(1.05) translateY(-20px);
  opacity: 0;
}

.scale-down-enter-from {
  transform: scale(1.05) translateY(-20px);
  opacity: 0;
}

.scale-down-leave-to {
  transform: scale(0.95) translateY(20px);
  opacity: 0;
}

/* 垂直滑动转场效果 */
.slide-up-enter-active,
.slide-up-leave-active,
.slide-down-enter-active,
.slide-down-leave-active {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-up-enter-from {
  transform: translateY(100%);
  opacity: 0;
}

.slide-up-leave-to {
  transform: translateY(-100%);
  opacity: 0;
}

.slide-down-enter-from {
  transform: translateY(-100%);
  opacity: 0;
}

.slide-down-leave-to {
  transform: translateY(100%);
  opacity: 0;
}

/* 淡入淡出转场效果 */
.fade-enter-active,
.fade-leave-active {
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* 翻转转场效果 */
.flip-enter-active,
.flip-leave-active {
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.flip-enter-from {
  transform: rotateY(-90deg);
  opacity: 0;
}

.flip-leave-to {
  transform: rotateY(90deg);
  opacity: 0;
}

/* 3D翻转转场效果 */
.flip-3d-enter-active,
.flip-3d-leave-active {
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.flip-3d-enter-from {
  transform: rotateY(-90deg) rotateX(10deg);
  opacity: 0;
}

.flip-3d-leave-to {
  transform: rotateY(90deg) rotateX(-10deg);
  opacity: 0;
}

/* 默认转场效果 */
.slide-enter-active,
.slide-leave-active {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-enter-from {
  transform: translateX(100%);
  opacity: 0;
}

.slide-leave-to {
  transform: translateX(-100%);
  opacity: 0;
}

/* 转场容器样式 */
.slide-left-transition,
.slide-right-transition,
.scale-up-transition,
.scale-down-transition,
.slide-up-transition,
.slide-down-transition,
.fade-transition,
.flip-transition,
.flip-3d-transition,
.default-transition {
  position: absolute;
  width: 100%;
  min-height: 100vh;
}

/* 确保转场期间内容不会闪烁 */
.transition-container [class*="-transition"] {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  will-change: transform, opacity;
}

/* 性能优化 */
.transition-container {
  will-change: transform, opacity;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* 移动端优化 */
@media (max-width: 768px) {
  .slide-left-enter-active,
  .slide-left-leave-active,
  .slide-right-enter-active,
  .slide-right-leave-active,
  .scale-up-enter-active,
  .scale-up-leave-active,
  .scale-down-enter-active,
  .scale-down-leave-active,
  .slide-up-enter-active,
  .slide-up-leave-active,
  .slide-down-enter-active,
  .slide-down-leave-active,
  .fade-enter-active,
  .fade-leave-active,
  .flip-enter-active,
  .flip-leave-active,
  .flip-3d-enter-active,
  .flip-3d-leave-active,
  .slide-enter-active,
  .slide-leave-active {
    transition-duration: 0.25s;
  }
}

/* 转场期间的滚动条隐藏 */
.transition-container.transitioning {
  
}

/* 转场完成后的状态 */
.transition-container.transition-complete {
  overflow: visible;
}

/* 特殊转场效果：弹性回弹 */
.bounce-enter-active,
.bounce-leave-active {
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bounce-enter-from {
  transform: scale(0.3);
  opacity: 0;
}

.bounce-leave-to {
  transform: scale(0.3);
  opacity: 0;
}

/* 特殊转场效果：滑入滑出 */
.slide-in-enter-active,
.slide-in-leave-active {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-enter-from {
  transform: translateX(-100%);
  opacity: 0;
}

.slide-in-leave-to {
  transform: translateX(100%);
  opacity: 0;
}

/* 转场加载状态 */
.transition-loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.transition-loading .loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #ff6b35;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 转场错误状态 */
.transition-error {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #e74c3c;
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 转场成功状态 */
.transition-success {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #27ae60;
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  animation: slideInRight 0.3s ease-out;
}

/* 转场进度条 */
.transition-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ff6b35, #ff8c42);
  z-index: 10000;
  transform-origin: left;
  animation: progressGrow 0.3s ease-out;
}

@keyframes progressGrow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* 转场完成动画 */
.transition-complete-animation {
  animation: completePulse 0.5s ease-out;
}

@keyframes completePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}
